﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1.DesignerPatter.Visitor
{
    public class ObjectStructure
    {
        IList<Person> actList = new List<Person>();

        public void Add(Person p)
        {
            actList.Add(p);
        }

        public void Remove(Person p)
        {
            actList.Remove(p);
        }

        public void Display(Action act)
        {
            foreach(Person p in actList)
            {
                p.Accept(act);
            }
        }
    }
}
